package com.joint.web.action.com;

import com.fz.us.base.bean.BaseEnum;
import com.fz.us.base.bean.Pager;
import com.google.common.collect.Maps;
import com.joint.base.entity.Company;
import com.joint.core.entity.ProInfoLog;
import com.joint.core.service.ProinfoLogService;
import com.joint.web.action.BaseAdminAction;
import org.apache.struts2.convention.annotation.ParentPackage;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by amin on 2015/4/20.
 */
@ParentPackage("com")
public class AjaxProinfoLogAction extends BaseAdminAction {
    @Resource
    ProinfoLogService proinfoLogService;
    private String proInfoId;

    private ProInfoLog proInfoLog;
    private List<ProInfoLog> proInfoLogList;
    public String read(){
        Company company=usersService.getCompanyByUser();
        Map<String,Object> rmap= Maps.newHashMap();
        rmap.put("proInfo.id",proInfoId);
        rmap.put("state", BaseEnum.StateEnum.Enable);
        proInfoLogList= (List<ProInfoLog>)proinfoLogService.findByPagerAndCompany(new Pager(),null,company,rmap).getList();
        return "read";
    }

    public ProInfoLog getProInfoLog() {
        return proInfoLog;
    }

    public void setProInfoLog(ProInfoLog proInfoLog) {
        this.proInfoLog = proInfoLog;
    }

    public String getProInfoId() {
        return proInfoId;
    }

    public void setProInfoId(String proInfoId) {
        this.proInfoId = proInfoId;
    }

    public List<ProInfoLog> getProInfoLogList() {
        return proInfoLogList;
    }

    public void setProInfoLogList(List<ProInfoLog> proInfoLogList) {
        this.proInfoLogList = proInfoLogList;
    }
}
